<%@ page import="java.io.*" %><%@ page session="true" %><%@ page import="java.net.*" %><%@
page contentType="application/octet-stream;charset=euc-kr" %><%


boolean bFail = false;

session = request.getSession(true);
String strId = (String)session.getAttribute("id");
if(strId == null){
	bFail = true;
}

String strProjectId = request.getParameter("projectId");
if(strProjectId == null){
	bFail = true;
}

String strImageId = request.getParameter("imageId");
if(strImageId == null){
	bFail = true;
}


if(bFail == true){
	
}else{
	response.setHeader("Content-Type","image/jpeg");
	response.setHeader("Content-Transfer-Encoding", "binary;");
	response.setHeader("Pragma", "no-cache;");
	response.setHeader("Expires", "-1;");
	
	File file = new File("e:/imageStore/" + strImageId);
	
	if (file.exists() && (file.isDirectory() == false)){
		byte b[] = new byte[(int)file.length()];
		
	    BufferedInputStream fin = new BufferedInputStream(new FileInputStream(file));
	    BufferedOutputStream outs = new BufferedOutputStream(response.getOutputStream());
	    int read = 0;
	    
	    while ((read = fin.read(b)) != -1){
			outs.write(b,0,read);
	    }
	    
	    outs.close();
	    fin.close();
	}
	
	
}
%>